package com.yuebook.smartrpc.framework.invoker;

import com.google.common.collect.Maps;
import com.yuebook.smartrpc.framework.model.SmartRpcResponse;
import java.util.Map;

/**
 * @author honglei
 * @date 2018/11/23 下午2:39
 */
public class InvokerResponseHolder {

    private static Map<String, SmartRpcResponse> responseMap = Maps.newConcurrentMap();

    public static void putResponse(SmartRpcResponse response) {
        responseMap.put(response.getUniqueKey(), response);
    }

    public static SmartRpcResponse getResponse(String key) {
        return responseMap.get(key);
    }

    public static void removeResponse(String key) {
        responseMap.remove(key);
    }

}
